#include<iostream>
#include<cstring>
#include<cassert>
using namespace std;

namespace zx
{
   class string
   {
    public:
 		typedef char* iterator;
 		typedef const char* const_iterator;
        explicit string(const char*str = "" )
            :_size(strlen(str)),
            _capacity(_size),
			_str(new char[_capacity + 1])
        {        
             strcpy(_str,str);
        }

		explicit string(const string& s)
			:_size(s.size()),
			_capacity(s.capacity()),
			_str(new char[_capacity + 1])
		{
			strcpy(_str,s._str);
		}

        string(const string& s,size_t pos,size_t len = -1)
	    {
		    assert(pos <= s.size());
	        if(len == -1 || (pos + len > s.size()))
			{
               _size = strlen(&s[pos]);
			}
			else
			{
               _size = len;
			}
		    _capacity = _size;
			_str = new char[_capacity + 1];	
			if(len == 0)
			{
				_str[0] = '\0';
			}
			else
			{
		    	strncpy(_str,&s[pos],_size);
				_str[_size]='\0';
			}
	    }

		string(const char*str,size_t n)
		{
            assert(n >=0 && n <= strlen(str) + 1);
			_size = n;
			_capacity = _size;
			_str = new char[_capacity + 1];
            if(n == 0)
			{
				_str[0] = '\0';
			}
			else
			{
				strncpy(_str,str,n);
				_str[n] = '\0';
			}
		}

		string(size_t n,char c)
		{
			assert(n < -1);
			_size = n;
			_capacity = _size;
			_str = new char[_capacity + 1];
			if(n == 0)
			{
                _str[0] = '\0';
			}
			else
			{
                memset(_str,'c',n);
				_str[n] = '\0';
			}
		}

		~string()
		{
            delete[] _str;
            _str = nullptr;
			_size = _capacity = 0;
		}
        
		string& operator=(const char* s)
		{
			char*tmp = new char[strlen(s) + 1];
			strcpy(tmp,s);
            delete[] _str;
			_str = tmp;
			_size = strlen(s);
			_capacity = _size;
			return *this;
		}

        string& operator=(const string& s)
		{
		//traditional writing
		//  operator=(const string& s)
        //  if(this != &s)//traditional writing
		//	{
		//		char* tmp = new char[s.capacity() + 1];
        //        strcpy(tmp,s._str);
		//		delete[] _str;
		//		_str = tmp;
		//	    _size = s.size();
		//	    _capacity = s.capacity();
		//	}
		//modern writing
			if(this != &s)
			{
			    string tmp(s);
                swap(tmp);
			}
			return *this;
		}
        
        void swap(string& s)
		{
			std::swap(_str,s._str);
			std::swap(_size,s._size);
			std::swap(_capacity,s._capacity);
		}

        char& operator[](size_t pos)
	    {
		    assert(pos <= _size);
            return _str[pos];
	    }

        const char& operator[](size_t pos)const
	    {
		    assert(pos <= _size);
            return _str[pos];
	    }
        
        iterator begin()
		{
            return _str;
		}

		iterator end()
		{
			return _str + _size;
		}

        const_iterator begin()const
		{
			return _str;
		}

		const_iterator end()const
		{
			return _str+_size;
		}

	    void reserve(size_t n)
		{
			if(n > _capacity)
			{
			    char*tmp =new char[n + 1];
			    strcpy(tmp,_str);
			    delete[] _str;
				_str = tmp;
			    _capacity = n;
			}
		}

		void resize(size_t n,char c = '\0')
		{
			reserve(n);
			if(n > _size)
			{
                memset(_str+_size,c,n-_size); 
			}
			_str[n] = '\0';
			_size = n;
		}

		string& operator+=(const string& s)
		{
            if(_size + s.size() > _capacity)
			{
				reserve(_size + s.size());
			}
            strcpy(_str + _size,s.c_str());
			_size += s.size();
			return *this;
		}

		string& operator+=(const char*str)
		{
            if(_size + strlen(str) > _capacity)
			{
				reserve(_size + strlen(str));
			}
			strcpy(_str + _size,str);
			_size += strlen(str);
			return *this;
		}

		string& operator+=(char c)
		{
            if(_size + 1 > _capacity)
			{
				reserve(_size + 1);
			}
			_str[_size] = c;
			_size += 1;
			_str[_size] = '\0';
			return *this;
		}

		string& insert(size_t pos,const string&s)
		{
			assert(pos <= _size);
            if(_size + s.size() > _capacity)
			{
				reserve(_size + s.size());
			}
		    memmove(_str + pos + s.size(),_str + pos,_size-pos+1);
			strncpy(_str + pos,s.c_str(),s.size());
			_size += s.size();
			return *this;
		}

		string& insert(size_t pos,const char* s)
		{
            assert(pos <= _size);
		    if(_size + strlen(s) > _capacity)
			{
				reserve(_size + strlen(s));
			}
		    memmove(_str + pos + strlen(s),_str + pos,_size-pos+1);
			strncpy(_str + pos,s,strlen(s));
			_size += strlen(s);
			return *this;
		}

		string& insert(size_t pos,size_t n,char c)
		{
			assert(pos <= _size);
			if(_size + n > _capacity)
			{
				reserve(_size + n);
			}
			if(n > 0)
			{
		        memmove(_str + pos + n,_str + pos,_size-pos+1);
			    memset(_str + pos,c,n);
				_size += n;
			}
			return *this;
		}

		string& erase(size_t pos=0,size_t len=npos)
		{
			assert(pos < _size);
			if(len == 0)
				return *this;
			if(len==npos||pos + len >= _size)
			{
				_str[pos] = '\0';
				_size = pos;
			}
			else
			{
                strcpy(_str + pos,_str + pos + len);
				_size -= len;
			}
			return *this;
		}

		size_t find(char c,size_t pos = 0)
		{
            for(int i=pos;i<_size;++i)
			{
				if(c==_str[i])
					return i;
			}
			return npos;
		}

		size_t find(const char*str,size_t pos=0)
		{
		    size_t i=0;
			size_t arr[strlen(str)+1];
            while(str[i] != '\0')
			{
				size_t j=0;
                for(j=pos;j<_size;++j)
				{   
					if(str[i]==_str[j])
					{
						pos = j+1;
						break;
					}
				}
				if(j==_size)
				{
					return npos;
				}
				arr[i]=j;
				++i;                
			}
			return arr[0];
		}

        size_t size()const
		{
            return _size;  
		}
        
		size_t capacity()const
		{
            return _capacity;
		}

        const char* c_str()const
		{
			return _str;
		}

		void clear()
		{
			_str[0] = '\0';
			_size = 0;
		}

		bool empty()const
		{
			return _size;
		}

       bool operator<(const string& s)const
	   {
		   return strcmp(_str,s.c_str())<0;
	   }

	   bool operator>=(const string& s)const
	   {
		   return !(strcmp(_str,s.c_str())<0);
	   }

	   bool operator==(const string& s)const
	   {
		   return strcmp(_str,s.c_str())==0;
	   }

	   bool operator!=(const string& s)const
	   {
		   return !(strcmp(_str,s.c_str())==0);
	   }

	   bool operator>(const string& s)const
	   {
		   return strcmp(_str,s.c_str())>0;
	   }

	   bool operator<=(const string& s)const
	   {
		   return !(strcmp(_str,s.c_str())>0);
	   }

      private:
        size_t _size;
        size_t _capacity;
		char* _str;
		static const size_t npos;
   };
   
const size_t zx::string::npos = -1;

ostream& operator<<(ostream& out,const string& s)
{
	for(auto ch:s)
	{
		out<<ch;
	}
	return out;
}

istream& operator>>(istream& in,string& s)
{
    char ch = in.get();
	while(ch!=' '&&ch!='\n')
	{
		s+=ch;
		ch = in.get();
	}
	return in;
}

}

int main()
{
    zx::string s1("zhong");
	cin>>s1;
	cout<<s1<<endl;
    return 0;
}
